import argparse
from pathlib import Path
from openanno_cnv import set_annotation_parser
from .cnvseq import CNVseq


def main():
    parser = argparse.ArgumentParser(description="ClinCNV")
    parser.add_argument("--bam_file", "-in", type=Path, required=True, help="input, bam file, required")
    parser.add_argument("--bin_size", "-bin", type=int, default=100000, help="input, bin size, default: 100000")
    parser.add_argument("--thread", "-thread", type=int, default=1, help="input, thread number, default: 1")
    parser.add_argument("--gap_file", "-gap", type=Path, required=True, help="input, gap file, requrired")
    parser.add_argument("--gender", "-gender", choices=("male", "female"), help="input, sample gender")
    parser.add_argument("--max_female", "-max", type=float, default=0.06, help="input, max y/x reads ratio for female")
    parser.add_argument("--min_male", "-min", type=float, default=0.09, help="input, min y/x reads ratio for male")
    parser.add_argument("--outdir", "-out", type=Path, required=True, help="output, outdir, required")
    parser.add_argument("--dbdir", "-db", type=Path, help="input, database dir")
    set_annotation_parser(parser=parser)
    parser.set_defaults(func=lambda args: CNVseq(**vars(args)).run())
    args = parser.parse_args()
    args.func(args)
